import { 
  FlexDirection, 
  Align, 
  Justify, 
  Display,
  Wrap,
  PositionType 
} from "yoga-layout";

export const flexDirectionMap = {
  'row': FlexDirection.Row,
  'row-reverse': FlexDirection.RowReverse,
  'column': FlexDirection.Column,
  'column-reverse': FlexDirection.ColumnReverse,
} as const;

export const alignMap = {
  'auto': Align.Auto,
  'flex-start': Align.FlexStart,
  'center': Align.Center,
  'flex-end': Align.FlexEnd,
  'stretch': Align.Stretch,
  'baseline': Align.Baseline,
  'space-between': Align.SpaceBetween,
  'space-around': Align.SpaceAround,
  'space-evenly': Align.SpaceEvenly,
} as const;

export const justifyMap = {
  'flex-start': Justify.FlexStart,
  'center': Justify.Center,
  'flex-end': Justify.FlexEnd,
  'space-between': Justify.SpaceBetween,
  'space-around': Justify.SpaceAround,
  'space-evenly': Justify.SpaceEvenly,
} as const;

export const displayMap = {
  'flex': Display.Flex,
  'none': Display.None,
  'contents': Display.Contents,
} as const;

export const wrapMap = {
  'nowrap': Wrap.NoWrap,
  'wrap': Wrap.Wrap,
  'wrap-reverse': Wrap.WrapReverse,
} as const;

export const positionMap = {
  'static': PositionType.Static,
  'relative': PositionType.Relative,
  'absolute': PositionType.Absolute,
} as const;

// 类型定义
export type CSSFlexDirection = keyof typeof flexDirectionMap;
export type CSSAlign = keyof typeof alignMap;
export type CSSJustify = keyof typeof justifyMap;
export type CSSDisplay = keyof typeof displayMap;
export type CSSWrap = keyof typeof wrapMap;
export type CSSPosition = keyof typeof positionMap;
